<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>申请退款</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<link href="{$_G['URL']['REFUND_CSS']}css/public.css" rel="stylesheet" type="text/css" />
	<link href="{$_G['URL']['REFUND_CSS']}css/style.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="{$_G['URL']['FCWORK_CSS']}dist/mescroll.min.css">
	<script src="{$_G['URL']['FCWORK_CSS']}dist/mescroll.min.js" charset="utf-8"></script>
	<script src="{$_G['URL']['REFUND_CSS']}js/rem.js"></script>
	<link rel="stylesheet" type="text/css" href="{$_G['URL']['YX2020_CSS']}css/complain.css?v=2">
	<style type="text/css">
		.num {
			font-size: 0.25rem;
		}
	</style>
</head>
<body>
<div id="mescroll" class="mescroll">
	<div id="app">
		{if $op == 'showqr'}
		<div class="warp">
			<div class="RefundCode" style="margin-top: 0.4rem;">
				<div class="RefundCodeBox">
					<div class="title">申请退款二维码</div>

					<img class="code" id="qr_img" src="{$qr_img}"></img>
				</div>
			</div>

			<div class="tipText reTipText">注：需到店连接商家内部安全网络方可进行退款</div>
		</div>

		{else}
		<div class="warp payInfoWarp">

			<div class="payInfo">
				<div class="info">
					<div class="infoL">
						<div class="name">{$themyrecord['username']}</div>
						<div class="phone">
							<img src="{$_G['URL']['REFUND_CSS']}images/payInfoIcon.png"></img>
							<p>{$themyrecord['mobile']}</p>
						</div>
					</div>
					<img class="avatar" src="{$fans['avatar']}"></img>
				</div>
			</div>

			<div class="payBox">
				<div class="payBoxTop">
					<div class="title">
						<img src="{$_G['URL']['REFUND_CSS']}images/successIcon.png"></img>
						<p>支付成功</p>
					</div>
					<div class="price">{php echo sprintf("%.2f",$themyorder['realfee']);}</div>
				</div>
				<div class="payBoxBot">
					<div class="item">
						<div class="label">支付时间</div>
						<div class="num">{php echo date('Y-m-d  H:i:s',$themyorder['paytime']);}</div>
					</div>
					<div class="item">
						<div class="label">交易单号</div>
						<div class="num">{$themyorder['uniontid']}</div>
					</div>
					<div class="item">
						<div class="label">商户单号</div>
						<div class="num">{$themyorder['transaction_id']}</div>
					</div>
				</div>
			</div>
			{if $themyrecord['status'] == '1'}
			<a href="#" onclick="sureRefund()" class="btn">申请退款</a>
			{elseif $themyrecord['status'] == 0}
			<a href="#" onclick="javascript:window.history.back()" class="btn">未支付，返回</a>
			{elseif $themyrecord['status'] == -1}
			<a href="#" onclick="javascript:window.history.back()" class="btn">已退款，返回</a>
			{else}
			<a href="#" onclick="javascript:window.history.back()" class="btn">返回活动页面</a>
			{/if}
			<div class="payTipText">注：需到店连接商家内部安全网络方可进行退款</div>
		</div>

		<div class="modal" style="display: none;" id="suc">
			<div class="modal_content" style="height: 4rem;">
				<div class="title" style="color: #FFF;background: #2c90e6;">操作提示</div>
				<div class="desc" style="font-size: 0.35rem;">您确定要进行退款？</div>
				<div class="button-sp-area" style="margin-top: 0.5rem;">
					<a open-type="navigateBack" class="weui-btn weui-btn_primary closeDialog" aria-role="button" onclick="selfHide()" style="background-color: #999999;">取消</a>
					<a class="weui-btn weui-btn_primary complain" onclick="toRefund()" style="background-color: #03a9f4;">确定</a>
				</div>
			</div>
		</div>




		<script src="{$_G['URL']['REFUND_CSS']}js/jquery-2.1.1.min.js" type="text/javascript"></script>
		<script>
			function sureRefund(){
				//弹窗提示
				$("#suc").show();
			}
			function selfHide(){
				$("#suc").hide();
			}
			function toRefund(){
				$("#suc").hide();
				$.ajax({
					url:"/{php echo createMobileUrl('X_UserRefund', array('themeid'=>$themeid,'fromuid'=>$fromuid));}",
					dataType:'json',
					method:'post',
					data:{},
					success:function (e) {
						console.log(e);
						if(e.error==0){
							alert('退款成功！');
							location.reload()
						}else{
							alert(e.msg);
						}
					},
					fail:function (err) {
						console.log(err)
					}
				})
			}
		</script>
		{/if}
	</div>
</div>
<script>
	const mescroll = new MeScroll("mescroll", {
		down: {
			auto: false,
			callback: () => {
				mescroll.endSuccess();
				setTimeout(() => {
					window.location.reload();
				},500)
			}
		},
		up: {
			use: false
		}
	})
</script>
{include file='fcworker/fc_base_foot'}
</body>
</html>
